package biiaoqi;

import java.util.*;

public class test {
    public static void main(String[] args) {
        List<student>students=new ArrayList<>();
        students.add(new student("bb",120,0));
        students.add(new student("cc",140,2));
        students.add(new student("aa",112,10));
        students.add(new student("ff",142,142));
        students.add(new student("ww",142,142));
        //内部比较器
        Set<student> studentSet=new TreeSet<>();
        studentSet.addAll(students);
        for (student student1:studentSet){
            System.out.println(student1);
        }



      /*  //外部比较器
        for(student student :students){
            System.out.println("----------");
        }
        Collections.sort(students, new Comparator<student>() {
            @Override
            public int compare(student o1, student o2) {
               *//* return o2.getAge()==o1.getAge()?o2.getGender()-o1.getGender():o2.getAge()-o1.getAge();*//*
                //字典查法
           return  (o1.getName().compareTo(o2.getName()));
            }
        });
        for (student student:students){
            System.out.println(student);
        }*/

    }
}
